
import axios from "../index";

const URLs = {
  getUsersById: '/user/',
  getUserList:'/user/list',
  Login: '/Login/studentLogin'
}

export interface User {
  id: number;
  name: string;
  email: string;
  password: string
  phone: string;
  address: string;
  isadmin: boolean;
  isvalidate: boolean;
  studentaccount: string;
}
export default{
  getUsersById: async (id: number) => {
    return axios.get(URLs.getUsersById + id)
  },

  getUserList: async () => {
    return axios.get(URLs.getUserList)
  },

  //传入用户体
  LoginByUsername: async (studentaccount: string, password: string) => {
    return axios.post(URLs.Login, {studentaccount, password})
  }
}
